

import 'package:flutter/material.dart';
import 'package:xim/common/style/colors.dart';
import 'package:xim/widget/common/state.dart';
import 'package:xim/widget/common/ui/cell.dart';

class DetailProfileInfoPage extends StatefulWidget {

  final String account;

  const DetailProfileInfoPage({Key? key, required this.account}) : super(key: key);

  @override
  State<DetailProfileInfoPage> createState() => _DetailProfileInfoPageState();

}

class _DetailProfileInfoPageState extends  AppBarState<DetailProfileInfoPage>
with ShimmerState<DetailProfileInfoPage>, BrightnessModeState<DetailProfileInfoPage>{

  @override
  String get appBarTitle => "更多消息";

  ModelColor bgColor = ModelColor(lightColor: const Color(0xffececec), darkColor: const Color(0xff101010));
  ModelColor fgColor = ModelColor(lightColor: const Color(0xfffefefe), darkColor: const Color(0xff181818));
  ModelColor textColor = ModelColor(lightColor: const Color((0xff181818)), darkColor: const Color(0xfffefefe));

  @override
  List<ModelColor> get brightnessColors => [bgColor,fgColor,textColor];

  @override
  Color get appBarBgColor => fgColor.color;

  @override
  IconThemeData get iconTheme => IconThemeData(color: fgColor.reverse);

  @override
  TextStyle get appBarTitleStyle => TextStyle(color: textColor.color);

  @override
  Future<void> initData() async {}

  @override
  Widget widgetBuild(BuildContext context) {
    initModelColor(context);
    return Scaffold(
      appBar: appBar,
      body: Container(
        color: bgColor.color,
        child: Column(
          children: [
            const SizedBox(height:8,),
            Cell.titleCell(
              title: "好友创建时间", titleStyle: TextStyle(color: textColor.color),
              decoration: BoxDecoration(color: fgColor.color,),
              padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
              rightItem: Text("2024-03-05", style: TextStyle(color: textColor.color),),
            ),
            const SizedBox(height:8,),
            Cell.titleCell(
              title: "来源", titleStyle: TextStyle(color: textColor.color),
              decoration: BoxDecoration(color: fgColor.color,),
              padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
              rightItem: Text("扫一扫（二维码）", style: TextStyle(color: textColor.color),),
            ),
            const SizedBox(height:8,),
            Cell.titleCell(
              title: "账号公钥", titleStyle: TextStyle(color: textColor.color),
              decoration: BoxDecoration(color: fgColor.color,),
              padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
              rightItem: Cell.iconItem(iconData: Icons.chevron_right, iconStyle: IconStyle(size: 14, color: textColor.color)),
              onTab: (){
                // --
              },
            ),
          ],
        ),
      ),
    );
  }

}
